//如果用uni请求
// import http from './http.interceptor.js';

//如果是用uview请求,就用下面这句
const http = uni.$u.http

let api = {
	// 微信登录
	wechatlogin: params => http.post('/auth/oauth/token?grant_type=wx_code&loginCode=' + params.logincode + '&phoneCode=' + params.phonecode, params), //微信登录
	uploadfile: params => http.post('/system/upload' + params), //上传图片

	// 当前订单可用优惠券
	currentOrderCoupon: params => http.get('/system/app/client/coupon/available?imei=' + params.imei + '&programId	=' + params.programId, params), //当前订单可用优惠券	

	// 优惠券列表
	couponList: params => http.get('/system/app/client/coupon/public'), //优惠券列表

	// 用户领取的优惠券列表
	userCouponList: params => http.get('/system/app/client/coupon/user'), //用户领取的优惠券列表

	// 设备程序列表
	deviceProgramList: params => http.get('/system/app/client/storefront/device/program?imei=' + params.imei, params), //设备程序列表

	// 店面设备列表
	storefrontDeviceList: params => http.get('/system/app/client/storefront/device?storefrontId=' + params.storefrontId, params), //店面设备列表

	// 店面列表
	storefrontList: params => http.get('/system/app/client/storefront/list?lat=' + params.lat + '&lng=' + params.lng+'&limit='+params.limit+'&page='+params.page, params), //店面列表

		// 订单详情
		orderDetail: params => http.get('/system/app/client/order/detail?orderId=' + params.orderId, params), //订单详情
		// 订单列表
		orderList: params => http.get('/system/app/client/order/list?limit='+params.limit+'&page='+params.page, params), //订单列表

		// 创建订单
		createOrder: params => http.post('/system/app/client/order/start', params), //创建订单
}


export default api;